<#assign ctx=request.contextPath />
<!doctype html>
<html class="no-js fixed-layout">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>密钥管理</title>
<meta name="keywords" content="index">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="stylesheet" href="${ctx}/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="${ctx}/bootstrap/css/bootstrap-table.min.css" />
<style type="text/css">
</style>
</head>
<body>
	<div class="container">
		<ul class="nav nav-tabs nav-pills">
	 		<li role="presentation"><a href="${ctx}/code/index">动态代码管理</a></li>
	 		<li role="presentation"><a href="#">动态配置管理</a></li>
	 		<li role="presentation" class="active"><a href="${ctx}/app/toList">密钥管理</a></li>
		</ul>
		<div class="row" style="margin-top:10px;padding:12px;">
			<div class="well">
				<table id="table" style="word-break:break-all; word-wrap:break-all;"></table>
			</div>
		</div>
	</div>

	<script src="${ctx}/jquery/jquery.min.js"></script>
	<script src="${ctx}/bootstrap/js/bootstrap.min.js"></script>
	<script src="${ctx}/bootstrap/js/bootstrap-table.min.js"></script>
	<script src="${ctx}/bootstrap/local/bootstrap-table-zh-CN.min.js"></script>
	<script type="text/javascript">
		$(function() {
			$('#table').bootstrapTable({
				url : '${ctx}/app/list',
				method: 'post',
				contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
				dataType : "json",
				pagination : true,
				sidePagination : "server",
				queryParams: function(params) {
					return {
							pageSize : params.limit, //页面大小
							pageNumber : params.offset + 1, //页码
							current: (params.limit == 0 ? 0 : params.offset/params.limit) + 1
						   };
				},
				pageNumber : 1,
				pageSize : 10,
				cache : false,
				striped : true,
				clickToSelect: true,
				columns : [{
					field : 'appCode',
					width : '10%',
					title : 'AppCode'
				}, {
					field : 'appName',
					width : '10%',
					title : 'app名称'
				}, {
					field : 'priKey',
					width : '70%',
					title : '密钥'
				},{
					field : 'download',
					width : '10%',
					title : '下载',
					align:"center",
					formatter:function(value,row,index){
						var strHtml ='<a href="javascript:void(0);" onclick="down(\''+ row.appCode +'\');" data-toggle="tooltip" data-placement="top" title="下载"><li class="glyphicon glyphicon-download-alt"></li></a>'; 
						return strHtml;
					}
				}]
			});
		});
		function down(appCode) {
			alert(appCode);
			window.location.href = "${ctx}/app/" + appCode + "/download";
		}
	</script>
</body>
</html>